package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-05-11
 * Time: 10:46
 */
class C {
    int sub(int p, int q) {
        return p - q;
    }

    float sub(float r, int w) {
        return r - w;
    }
}

class T {
    int b = 6, c = 8;

    void ff() {
        int b = 4, c = 3;
        this.b = b + 3;//this.b=6
        c = this.c + 6;//c=9
        System.out.println("ff:b=" + b + ",c=" + c);
//
    }
}

public class Test {
    public static void main(String[] args) {
        //   T sc = new T();
        // sc.ff();
        int a[] = {2, 4, 6, 8, 10};
        int s = 2;
        try {
            for (int i = 0; i < a.length; i++) {
                int item = 16 / a[i];
                s = s * item;
            }
            System.out.println("Success");
        } catch (ArithmeticException e) {
            System.out.println("computer ERROR!");
        }
        System.out.println("s=" + s);
    }

    public static void main1(String[] args) {
        C com = new C();
        int k = 10;
        int z = 20;
        int r1 = com.sub(k, z);
        float r2 = com.sub(k, z);
        System.out.println("r1=" + r1);
        System.out.println("r2=" + r2);
    }
}
